﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

                    xmlns:connects="clr-namespace:MiniUML.Plugins.UmlClassDiagram.Controls.View.Connect"
                    xmlns:keys="clr-namespace:MiniUML.Plugins.UmlClassDiagram.Controls.ViewModel"
                    >

    <!-- Association Connection -->
  <DataTemplate x:Key="{x:Static keys:ShapeViewModelKeyStrings.ShapeAssociation}">
      <connects:GenericUmlAssociation
        FromArrow="{Binding Path='FromArrow'}"
        ToArrow="{Binding Path='ToArrow'}"

        Stroke="{Binding Path='Stroke'}"

        FromName="{Binding Path='From'}"
        ToName="{Binding Path='To'}" />
  </DataTemplate>

  <!-- Uml.Arrows.Triangle (as used in inheritance arrow) -->
  <DataTemplate x:Key="{x:Static keys:ConnectorKeyStrings.UmlArrows_Triangle}">
      <Canvas Height="0" Width="0">
          <Grid Canvas.Right="0" Canvas.Top="-20">
              <Grid.RowDefinitions>
                  <RowDefinition Height="20"/>
                  <RowDefinition Height="20"/>
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                  <ColumnDefinition />
                  <ColumnDefinition Width="15"/>
              </Grid.ColumnDefinitions>
              <Polyline Grid.Column="1" Grid.RowSpan="2"  Height="30"
                        VerticalAlignment="Center" HorizontalAlignment="Right" Fill="White" Style="{DynamicResource StrokeStyle}">
                  <Polyline.Points>
                      <Point X="0" Y="10"/>
                      <Point X="10" Y="15"/>
                      <Point X="0" Y="20"/>
                      <Point X="0" Y="10"/>
                  </Polyline.Points>
              </Polyline>
          </Grid>
      </Canvas>
    </DataTemplate>

  <!-- Uml.Arrows.Arrow (as used in association arrow) -->
  <DataTemplate x:Key="Uml.Arrows.Arrow">
      <Canvas Height="0" Width="0">
          <Grid Canvas.Right="0" Canvas.Top="-20">
              <Grid.RowDefinitions>
                  <RowDefinition Height="20"/>
                  <RowDefinition Height="20"/>
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                  <ColumnDefinition />
                  <ColumnDefinition Width="15"/>
              </Grid.ColumnDefinitions>
              <Polyline Grid.Column="1" Grid.RowSpan="2" Height="30"
                        VerticalAlignment="Center" HorizontalAlignment="Right" Style="{DynamicResource StrokeStyle}">
                  <Polyline.Points>
                      <Point X="0" Y="10"/>
                      <Point X="10" Y="15"/>
                      <Point X="0" Y="20"/>
                  </Polyline.Points>
              </Polyline>
          </Grid>
      </Canvas>
  </DataTemplate>

  <!-- UML Diamond shape as used in Aggregation -->
  <DataTemplate x:Key="{x:Static keys:ConnectorKeyStrings.UmlArrows_WhiteDiamond}">
    <Canvas Height="0" Width="0">
      <Grid Canvas.Right="0" Canvas.Top="-20">
        <Grid.RowDefinitions>
          <RowDefinition Height="20"/>
          <RowDefinition Height="20"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition />
          <ColumnDefinition Width="15"/>
        </Grid.ColumnDefinitions>
        <Polyline Grid.Column="1" Grid.RowSpan="2"  Height="30"
                            VerticalAlignment="Center" HorizontalAlignment="Right" Fill="White" Style="{DynamicResource StrokeStyle}">
          <Polyline.Points>
            <Point X="5" Y="10"/>
            <Point X="10" Y="15"/>
            <Point X="5" Y="20"/>
            <Point X="0" Y="15"/>
            <Point X="5" Y="10"/>
          </Polyline.Points>
        </Polyline>
      </Grid>
    </Canvas>
  </DataTemplate>

  <!-- UML Diamond shape as used in Composition -->
  <DataTemplate x:Key="{x:Static keys:ConnectorKeyStrings.UmlArrows_BlackDiamond}">
    <Canvas Height="0" Width="0">
      <Grid Canvas.Right="0" Canvas.Top="-20">
        <Grid.RowDefinitions>
          <RowDefinition Height="20"/>
          <RowDefinition Height="20"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition />
          <ColumnDefinition Width="15"/>
        </Grid.ColumnDefinitions>
        <Polyline Grid.Column="1" Grid.RowSpan="2"  Height="30"
                              VerticalAlignment="Center" HorizontalAlignment="Right" Fill="Black" Style="{DynamicResource StrokeStyle}">
          <Polyline.Points>
            <Point X="5" Y="10"/>
            <Point X="10" Y="15"/>
            <Point X="5" Y="20"/>
            <Point X="0" Y="15"/>
            <Point X="5" Y="10"/>
          </Polyline.Points>
        </Polyline>
      </Grid>
    </Canvas>
  </DataTemplate>

</ResourceDictionary>